package com.hc.product.controller;

import com.hc.common.entity.Products;
import com.hc.product.service.ProductsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("products")
public class ProductsController {
    @Autowired
    private ProductsService productsService;

    @Value("${server.port}")
    private String port;

    @RequestMapping("select/{id}")
    public Products selectById(@PathVariable Integer id){
        return productsService.selectById(id);
    }

    @RequestMapping("selectPort")
    public String selectPort(){
        return port;
    }
}
